.reader-post-options-menu__ellipsis-menu {
	margin-left: 16px;

	.ellipsis-menu__toggle {
		padding: 0;
		height: 24px;
	}
}

.reader-post-options-menu__popover .popover__menu .popover__menu-item {
	align-items: center;
	display: flex;
	gap: 8px;

	&.follow-button:hover,
	&.follow-button:focus {
		.follow-button__label {
			color: var(--color-text-inverted);
		}

		.reader-following-feed,
		.reader-follow-feed {
			path {
				fill: var(--color-text-inverted);
			}
		}
	}

	&:hover,
	&:focus {
		svg {
			path {
				fill: var(--color-text-inverted);
			}
		}
	}

	svg {
		height: 24px;
		width: 24px;
	}
}

.reader-post-card.card,
.reader-post-card.card.is-compact {
	border-bottom: 5px solid var(--color-neutral-5);
	border-radius: 6px; /* stylelint-disable-line scales/radii */
	margin: 0;
	margin-bottom: 24px;
	position: relative;

	@include breakpoint-deprecated( "<660px" ) {
		background: none;
		border-radius: 0;
		box-shadow: none;
	}

	@include breakpoint-deprecated( ">660px" ) {
		border-bottom: none;
	}

	&.is-selected {
		&::before {
			content: "";
			position: absolute;
			top: 0;
			bottom: 0;
			left: -8px;
			width: 2px;
			background: var(--color-primary);

			@include breakpoint-deprecated( ">660px" ) {
				left: -16px;
			}
		}
	}

	&.is-seen {
		opacity: 0.5;
	}

	&.has-thumbnail {
		.reader-featured-image {
			box-sizing: border-box;
		}

		&.is-photo {
			.reader-post-card__post {
				flex-direction: column;
			}

			.reader-post-card__post-details,
			.reader-post-card__social {
				padding-left: 0;
			}

			.reader-post-card__post-details {
				flex: 0 auto; // IE11 Photo card actions hidden
				margin: 0;
				padding-top: 24px;
			}

			.reader-post-card__title {
				color: var(--color-text-inverted);
				font-family: $sans;
				position: relative;
				bottom: 30px;
				left: 20px;
				text-shadow: 0 1px rgba(0, 0, 0, 0.3);
				width: calc(100% - 44px);
				text-overflow: ellipsis;
				overflow: hidden;
				z-index: z-index("root", ".reader-post-card__title");
				margin-bottom: -15px; // relative elements need a negative margin so they don't create bottom padding
				height: 19px;
				white-space: nowrap;
			}

			.reader-post-card__title .reader-post-card__title-link {
				color: var(--color-text-inverted);
				display: inline;
				font-size: $font-body-extra-small;
				line-height: 20px;
			}

			.reader-post-actions {
				margin: 0;
			}

			.reader-post-actions .reader-post-actions__visit {
				margin-left: -3px;
			}
		}
	}

	&.has-thumbnail,
	&.is-gallery {
		.reader-post-card__post-details {
			flex: 1;
		}
	}

	&.is-gallery .reader-post-card__post {
		flex-direction: column;

		.dot-pager__controls {
			margin-bottom: 0;
			margin-top: 16px;
		}
		.dot-pager {
			display: flex;
			flex-direction: column-reverse;
		}
	}

	&.is-gallery,
	&.is-photo {
		.reader-post-card__post {
			margin-top: 8px;
		}
	}

	.reader-post-actions {
		margin: 16px 0 0;
	}

	&.is-compact {
		.reader-post-card__post {
			display: inherit;
			margin: 0;
		}

		.reader-post-card__post-heading {
			display: flex;
			justify-content: space-between;
		}

		.reader-post-card__post-content {
			flex-direction: row;
			gap: 24px;
			margin-bottom: 8px;

			@include breakpoint-deprecated( "<660px" ) {
				flex-direction: column-reverse;
				gap: 12px;
			}

			&.reader-post-card__no-excerpt {
				flex-direction: column;
				gap: 0;

				.reader-post-card__post-details {
					min-height: auto;
					padding-bottom: 6px;
				}
			}

			&:not(.reader-post-card__no-excerpt) {
				.reader-featured-image {
					width: 200px !important;

					@include breakpoint-deprecated( "<660px" ) {
						width: auto !important;
						height: 300px !important;
					}

					@include breakpoint-deprecated( "<480px" ) {
						height: 200px !important;
					}
				}
			}
		}

		.reader-post-card__post-details {
			margin: 0;
			min-height: 100px;
		}

		.reader-post-card__title-link {
			display: -webkit-box;
			-webkit-line-clamp: 2;
			-webkit-box-orient: vertical;
			overflow: hidden;
			overflow-wrap: anywhere;
			max-width: 344px;
		}

		.reader-post-card__post-media {
			flex-direction: row;
			text-align: right;
		}

		.reader-post-card__post-options {
			display: flex;
			justify-content: flex-end;
			align-items: center;
			margin-bottom: 16px;
		}

		.reader-excerpt {
			max-height: none;
			-webkit-line-clamp: 3;
		}
	}

	&:not(.is-compact) {
		.reader-post-card__post-details .reader-post-card__title {
			margin-top: 24px;
		}
		.reader-excerpt__content {
			margin: 7px 0 0;
		}
		.reader-featured-image {
			margin-top: 24px;
		}
		.reader-post-card__featured-images,
		.reader-featured-video {
			margin-top: 24px;
			.reader-featured-image {
				margin-top: 0;
			}
		}
		div[role="presentation"] {
			margin-top: 24px;
			padding-bottom: 24px;
			border-bottom: 1px solid var(--color-neutral-5);
		}
		.reader-post-actions {
			margin-top: 24px;
		}
		.comments__comment-list.is-inline {
			margin: 24px 0 0 10px;
			.comments__form {
				margin-top: 0;
			}

			.comments__comment .comments__form {
				margin-top: 10px;
			}

			@include breakpoint-deprecated( "<660px" ) {
				margin: 24px 0 0;
			}
		}
	}

	.reader-excerpt {
		display: -webkit-box;
		max-height: 45px;
		overflow: hidden;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		margin-bottom: 10px;
	}

	.reader-excerpt[direction="rtl"] {
		&::before {
			top: inherit;
		}
	}

	.reader-excerpt[direction="ltr"] {
		&::before {
			top: inherit;
		}
	}

	// When comment list is attached to reader post card, remove top border and margin to feel more
	// cohesive.
	.comments__comment-list {
		border-top: none;
		margin: 20px 0 0 10px;
		padding-top: 0;

		@include breakpoint-deprecated( "<660px" ) {
			margin: 20px 0 0;
		}
	}
}

.reader-post-card__conversation-post {
	.comments__comment-actions {
		display: flex;
		justify-content: flex-start;
		padding-top: 8px;
	}
}

.reader-post-card__photo {
	border-radius: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-basis: auto;
	flex-grow: 1;
	cursor: pointer;
	position: relative;
	top: 0;
	height: 300px;
	margin: 24px 0 0;
	max-width: 100%;

	&:hover {
		cursor: zoom-in;
	}

	&.is-expanded {
		background-position: center !important;
		border-radius: 4px;
		min-width: 100%;
		max-width: 100%;
		background-size: cover;

		&:hover {
			cursor: pointer;
		}
	}

	&::after {
		content: "";
		position: absolute;
		pointer-events: none;
		top: 0;
		left: 0;
		bottom: 0;
		right: 0;
		box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
		border-radius: 4px;
	}

	&::before {
		content: "";
		background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.37) 65%, rgba(0, 0, 0, 1) 110%);
		height: 80px;
		opacity: 0.4;
		position: absolute;
		bottom: 0;
		left: 0;
		width: 100%;
		border-radius: 0 0 4px 4px;
	}
}

.reader-post-card__byline {
	display: flex;
	font-size: $font-body-small;
}

.reader-post-card__author::after {
	content: ", ";
}

// Need .reader__content to override .reader__content a
.reader__content .reader-post-card__byline-secondary-item,
.reader__content .reader-post-card__tag-link {
	color: var(--color-neutral-40);
	font-size: 12px;
	margin-top: 2px;
	cursor: pointer;
	&:hover {
		color: var(--color-text-subtle);
	}
}

.reader__content .reader-post-card__tag-link {
	color: var(--color-neutral-100);
	&:focus {
		outline: dotted 1px;
	}
}

.reader-post-card__tag-link {
	text-decoration: none;
}

.reader-feed-header__seen-button:focus {
	outline: dotted 1px;
}

.reader-post-card__byline-secondary-item {
	// Add extra margin to give space for the bullet that may exist between items.
	margin-right: 12px;
	&:last-of-type {
		margin-right: 0;
	}
}

.reader-post-card__byline-secondary-bullet-wrapper {
	position: relative;
	display: inline-block;
	// Set bullet as relative absoulte position so it doesnt affect the layout when hiding it.
	.reader-post-card__byline-secondary-bullet {
		color: var(--color-text-subtle);
		position: absolute;
		left: -8px;
		bottom: -5px;
	}
}

.reader-post-card__byline-details {
	color: var(--color-primary);
	width: 100%;
	position: relative;
	top: 3px;
}

// Fix for IE11 unable to handle nested flexbox min-height.
// See issue: https://github.com/Automattic/wp-calypso/issues/9412
.is-reader-page .reader-post-card.is-gallery .reader-post-card__post-details {
	flex: inherit;
}

.reader-post-card__byline-site {
	font-family: $sans;
	font-weight: 600;
	margin-bottom: 2px;
	overflow: hidden;
	position: relative;
	height: 20px;
	width: calc(100% - 25px);

	&::after {
		@include long-content-fade( $size: 10% );
	}
}

.reader-post-card__author-and-timestamp {
	align-items: flex-start;
	display: flex;
	flex-direction: row;
	font-family: $sans;
	margin-top: -2px;
}

.reader-post-card__byline-secondary {
	display: inline-table;
}

.reader-post-card__tags {
	color: var(--color-neutral-70);
	display: flex;
	flex-direction: row;
	margin-top: 4px;
	margin-bottom: 8px;
	gap: 8px;
	flex-wrap: wrap;

	&::after {
		@include long-content-fade( $size: 35px );
	}
}

.reader-post-card__tag {
	white-space: nowrap;
	border-radius: 4px;
	padding: 0 9px 2px;
	background-color: var(--color-neutral-0);
	align-self: center;
}

.reader-post-card__byline .reader-avatar {
	flex-shrink: 0;

	.gravatar,
	.gridicon {
		float: left;
		height: 40px;
		margin: 4px 12px 0 0;
		vertical-align: text-top;
		width: 40px;
	}

	&.has-site-icon {
		margin: 0 12px 0 0;
	}

	.site-icon {
		width: 40px !important;
		height: 40px !important;
		font-size: 40px !important;
		line-height: 40px !important;
	}

	img {
		border-radius: 100%;
	}
}

.reader-post-card .has-site-and-author-icon .gravatar {
	display: none;
}

.reader-post-card__link {
	color: var(--color-neutral-100);
	cursor: pointer;
	font-size: 15px;

	&:hover {
		color: var(--color-text-subtle);
	}

	&:visited {
		color: var(--color-neutral-100);
	}
}

.reader-post-card__post {
	clear: both;
	display: flex;
	flex-direction: column;
	margin-left: 52px;

	.reader-post-card__post-details {
		width: 100%;
	}
}

@include breakpoint-deprecated( "<660px" ) {
	.reader-post-card__post {
		margin: 0;
	}
}

.reader-post-card.is-expanded-video .reader-post-card__post {
	flex-wrap: wrap;
}

.reader-post-card__post-details {
	font-family: $sans;
}

.reader-post-card__title {
	line-height: 1.4;
	margin-top: -4px;
	overflow-wrap: break-word;
}

// Needs to overwrite .reader__content a
.reader__content .reader-post-card__title-link,
.reader__content .reader-post-card__title-link:visited,
.reader-post-card__title-link,
.reader-post-card__title-link:visited {
	color: var(--color-neutral-100);
	cursor: pointer;
	font-size: $font-title-small;
	font-weight: 600;
	display: block;
	line-height: 29px;
	text-wrap: pretty;

	&:hover {
		color: var(--color-neutral-70);
	}
}

.reader-post-card .reader-excerpt {
	color: var(--color-neutral-80);
	font-family: $sans;
	font-size: $font-body;
	line-height: 22px;
	font-weight: 400;
	margin-top: 7px;
	word-break: break-word;
	position: relative;

	p {
		font-family: $sans;
		margin: 0;
	}
}

// Action buttons in post card
.reader-post-card.card .reader-post-actions__item {

	.reader-share__button .gridicon {
		margin-right: 0;
	}

	.comment-button .gridicon {
		margin-right: 2px;
	}

	.like-button {
		align-items: center;
		display: flex;
		text-align: left;
	}

	.reader-share__button-label,
	.comment-button__label-status,
	.like-button__label-status {
		@include breakpoint-deprecated( ">960px" ) {
			@include hide-content-accessibly();
		}

		@include breakpoint-deprecated( "<660px" ) {
			@include hide-content-accessibly();
		}
	}

	&:hover,
	button.is-active,
	.like-button.is-liked {
		svg.reader-external path {
			fill: var(--color-link);
		}

		svg.reader-comment path,
		svg.reader-share path {
			stroke: var(--color-link);
		}
		svg.reader-star path {
			stroke: var(--color-link);
		}
	}

	.like-button.is-liked {
		svg.reader-star path {
			fill: var(--color-link);
		}
	}
}

// Follow button for stream cards
.reader-post-card.card .follow-button {

	.gridicon {
		fill: var(--color-primary);
	}

	.follow-button__label {
		color: var(--color-primary);
	}

	&:hover {
		.follow-button__label {
			color: var(--color-success);
		}
	}

	&.is-following {
		.gridicon {
			fill: var(--color-success);
		}

		.follow-button__label {
			color: var(--color-success);
		}
	}

	&.is-discover {
		position: relative;
		top: 0;
		float: none;
		margin-top: 10px;
		margin-bottom: 3px;

		.follow-button__label {
			@include breakpoint-deprecated( "<660px" ) {
				display: inline;
			}
		}
	}
}

// Gallery cards
.reader-post-card .reader-featured-video__video {
	padding-bottom: 0;
}

.reader-post-card__gallery-image {
	border-radius: 4px;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
	height: 300px;
}

.reader-post-card__blocked-description {
	margin-bottom: 0;
	color: var(--color-neutral-70);
}

.reader-post-card__blocked-undo {
	padding-left: 2px;
	cursor: pointer;
	color: var(--color-primary);

	&:hover {
		color: var(--color-link-dark);
	}
}

// For these borderless cards to look more presentable on Devdocs
.is-section-devdocs .reader-post-card.card {
	padding: 16px;
}

.reader-post-card__featured-images {
	align-items: stretch;
	display: flex;
	flex-wrap: wrap;
	padding: 0;
	margin: 0;
	flex-direction: row;
	gap: 2px;

	&.column {
		flex-direction: column;
	}

	&.four-images {
		border-radius: 6px; /* stylelint-disable-line scales/radii */
		height: 302px;
		max-height: 302px;

		.reader-post-card__featured-images-item {
			width: calc(50% - 1px);
		}
		.reader-featured-image {
			border-radius: 0;
			height: 100%;
			max-height: 150px;
			overflow: hidden;
		}
		.reader-featured-image img,
		.reader-featured-image::after {
			border-radius: 0;
			object-fit: cover;
		}
		.reader-post-card__featured-images-item:first-child {
			.reader-featured-image,
			.reader-featured-image::after,
			img {
				border-top-left-radius: 6px; /* stylelint-disable-line scales/radii */
			}
		}
		.reader-post-card__featured-images-item:nth-child(2) {
			.reader-featured-image,
			.reader-featured-image::after,
			img {
				border-top-right-radius: 6px; /* stylelint-disable-line scales/radii */
			}
		}
		.reader-post-card__featured-images-item:nth-child(3) {
			.reader-featured-image,
			.reader-featured-image::after,
			img {
				border-bottom-left-radius: 6px; /* stylelint-disable-line scales/radii */
			}
		}
		.reader-post-card__featured-images-item:last-child {
			.reader-featured-image,
			.reader-featured-image::after,
			img {
				border-bottom-right-radius: 6px; /* stylelint-disable-line scales/radii */
			}
		}
	}

	&.three-images {
		border-radius: 6px; /* stylelint-disable-line scales/radii */

		.reader-featured-image {
			border-radius: 0;
			height: 302px;
			max-height: 302px;
		}
		.reader-featured-image img,
		.reader-featured-image::after {
			border-radius: 0;
			object-fit: cover;
		}
		/* First image */
		.reader-post-card__featured-images-item:first-child {
			border-top-left-radius: 6px; /* stylelint-disable-line scales/radii */
			border-bottom-left-radius: 6px; /* stylelint-disable-line scales/radii */
			max-height: 302px;
			overflow: hidden;
			width: calc(50% - 1px);
			.reader-featured-image::after {
				border-top-left-radius: 6px; /* stylelint-disable-line scales/radii */
				border-bottom-left-radius: 6px; /* stylelint-disable-line scales/radii */
			}
		}
		.reader-post-card__featured-images-item:first-child img {
			border-bottom-left-radius: 6px; /* stylelint-disable-line scales/radii */
			border-top-left-radius: 6px; /* stylelint-disable-line scales/radii */
			height: 100%;
			max-width: none;
			object-fit: cover;
			overflow: hidden;
			width: 100%;
		}
		/* Second and third images */
		.column-two .reader-post-card__featured-images {
			margin-top: 0;
		}
		.reader-post-card__featured-images-item.column-two {
			width: calc(50% - 1px);
		}
		.reader-post-card__featured-images-item.column-two .reader-post-card__featured-images.column {
			.reader-post-card__featured-images-item {
				height: auto;
				width: auto;
			}
			.reader-post-card__featured-images-item:first-child {
				border-radius: 0;

				img {
					border-radius: 0;
					border-top-right-radius: 6px; /* stylelint-disable-line scales/radii */
					object-fit: cover;
				}
				.reader-featured-image {
					border-radius: 0;
					border-top-right-radius: 6px; /* stylelint-disable-line scales/radii */
					height: 150px;
					overflow: hidden;

					&::after {
						border-top-right-radius: 6px; /* stylelint-disable-line scales/radii */
					}
				}
			}
			.reader-post-card__featured-images-item:last-child {
				border-radius: 0;

				img {
					border-radius: 0;
					border-bottom-right-radius: 6px; /* stylelint-disable-line scales/radii */
					object-fit: cover;
				}
				.reader-featured-image {
					border-radius: 0;
					border-bottom-right-radius: 6px; /* stylelint-disable-line scales/radii */
					max-height: 150px;
					overflow: hidden;

					&::after {
						border-bottom-right-radius: 6px; /* stylelint-disable-line scales/radii */
					}
				}
			}
		}
	}

	&.two-images {
		border-radius: 6px; /* stylelint-disable-line scales/radii */

		.reader-post-card__featured-images-item {
			width: calc(50% - 1px);
		}
		.reader-featured-image {
			border-radius: 0;
			height: 300px;
			max-height: 300px;
		}
		.reader-featured-image img,
		.reader-featured-image::after {
			border-radius: 0;
			height: 100%;
			max-width: none;
			object-fit: cover;
			overflow: hidden;
			width: 100%;
		}
		.reader-post-card__featured-images-item:first-child {
			.reader-featured-image,
			.reader-featured-image::after,
			img {
				border-bottom-left-radius: 6px; /* stylelint-disable-line scales/radii */
				border-top-left-radius: 6px; /* stylelint-disable-line scales/radii */
			}
		}
		.reader-post-card__featured-images-item:last-child {
			.reader-featured-image,
			.reader-featured-image::after,
			img {
				border-bottom-right-radius: 6px; /* stylelint-disable-line scales/radii */
				border-top-right-radius: 6px; /* stylelint-disable-line scales/radii */
			}
		}
	}
	&.one-image {
		.reader-post-card__featured-images-item {
			width: 100%;
		}
		img {
			object-fit: cover;
		}
	}
	.reader-featured-image {
		position: relative;
		&::after {
			content: "";
			position: absolute;
			pointer-events: none;
			top: 0;
			left: 0;
			bottom: 0;
			right: 0;
			box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
			border-radius: 6px; /* stylelint-disable-line scales/radii */
		}
	}
}

.reader-post-card__featured-images-item {
	padding: 0;
	cursor: pointer;
	list-style-type: none;
}

.reader-post-card__featured-images-img {
	vertical-align: middle;
}

.tag-stream__main .reader-post-card__byline-details {
	display: flex;
	justify-content: space-between;

	.reader-post-options-menu__ellipsis-menu {
		margin-top: -2px;
		margin-left: 5px;
	}
}

.reader-post-card__post-content {
	display: flex;
}
